package com.ayu.envdemo.service.impl;

import com.ayu.envdemo.entity.DeviceMonitorMongodb;
import com.ayu.envdemo.service.DeviceMongoService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.mongodb.core.MongoTemplate;
import org.springframework.stereotype.Service;

/**
 * @Author 徐林玉
 * @Description DeviceMongoServiceImpl
 * @Date 2023/2/20 14:54
 * @Version 1.0
 */
@Service
public class DeviceMongoServiceImpl implements DeviceMongoService {


    private final MongoTemplate mongoTemplate;

    @Autowired
    public DeviceMongoServiceImpl(MongoTemplate mongoTemplate) {
        this.mongoTemplate = mongoTemplate;
    }

    @Override
    public void save(DeviceMonitorMongodb data) {

        mongoTemplate.insert(data);

    }
}
